import TaskController from "@/contrib/task/controller"
import { TaskPriority, TaskType } from "@/contrib/task/types"

export default {

    add() {

        // const taskId = TaskController.addTransportTask(TransportTaskType.GET, 'E35S49', 'E35S49', '618be4a3cf4470cffa5e7a82', '6193a454df87dd0d29bf414a', RESOURCE_ENERGY, 100)
        // const taskId = TaskController.addTransportTask(
        //     TaskPriority.HIGH, 'E35S49', 'E35S49', '6193d4e052641d9cf92e9add', '618be4a3cf4470cffa5e7a82', RESOURCE_GHODIUM_HYDRIDE, 130
        // )
        const taskId = TaskController.addTransportTask(
            TaskPriority.HIGH, 'E38S52', 'E39S52', '6175b148cfad288336d18c7b', '6199f5f8592b91fb40b56826', RESOURCE_ENERGY, 300
        )

        return taskId

    },
    accept(id: number) {

        const task = TaskController.acceptTask(TaskType.TRANSPORT, id)
        if (task) {
            return task.id
        }
        return task

    },
    finish(id: number) {

        TaskController.finishTask(TaskType.TRANSPORT, id)

        return ''

    },

    /**
     * 帮助
     */
    help() {
        return 'list()'
    }
}

